﻿namespace Devonline.Entity;

/// <summary>
/// 订单货运单
/// </summary>
[Table("order_transport"), DisplayName("订单货运单")]
public class OrderTransport : OrderTransport<string>, IEntitySet, IEntitySetWithCreate
{
    /// <summary>
    /// 货运单
    /// </summary>
    public virtual Transport? Transport { get; set; }
}

/// <summary>
/// 订单货运单
/// </summary>
/// <typeparam name="TKey"></typeparam>
[Table("order_transport"), DisplayName("订单货运单")]
public abstract class OrderTransport<TKey> : EntitySetWithCreate<TKey>, IEntitySet<TKey>, IEntitySetWithCreate<TKey> where TKey : IConvertible
{
    /// <summary>
    /// 订单编号
    /// </summary>
    [Column("order_id"), DisplayName("订单编号"), Required, MaxLength(36), Excel]
    public virtual TKey OrderId { get; set; } = default!;
    /// <summary>
    /// 货运单编号
    /// </summary>
    [Column("transport_id"), DisplayName("货运单编号"), Required, MaxLength(36), Excel]
    public virtual TKey TransportId { get; set; } = default!;
}